package com.lorizz.index.impl;

import java.io.File;

import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;

public abstract class FileSystemIndexer<T> extends AbstractIndexer<T> {

	private String filePath;
	protected Directory directory;

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	
	public String getFilePath() {
		return filePath;
	}

	public void init() {
		try {
			directory = FSDirectory.open(new File(filePath));
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	protected Directory getDirectory() {
		return directory;
	}

}
